This disclosure relates generally to the field of color balancing. More particularly, but not by way of limitation, it relates to techniques for alleviating problems associated with dominant color failures in auto white balance (AWB) algorithms.
Color balancing may be thought of as the global adjustment of the intensities of the colors in an image. One goal of color balancing is to render specific colors, e.g., neutral white, as accurately as possible to the way the color appeared in the actual physical scene from which the image was captured. In the case of rendering neutral white colors correctly, the process is often referred to as “white balancing,” Most digital cameras base their color balancing and color correction decisions at least in part on the type of scene illuminant. For example, the color of a white sheet of paper will appear differently under fluorescent lighting than it will in direct sunlight. The type of color correction to be performed may be specified manually by a user of the digital camera who knows the scene illuminant for the captured image, or may be set programmatically using one or more of a variety of AWB algorithms.
Dominant color failure is a common problem in AWB algorithms that use image pixel information to estimate the white point of the scene. The light signal received by each image sensor pixel is a product of the scene illuminant and the reflectance spectra of the object surfaces in the scene, so it is difficult to isolate the illuminant color from surface color based on the pixel values. Most white balance algorithms make assumptions about the statistical distributions of object surface reflectance in the real world, as well as assuming a reasonably diverse number of different surfaces in the scene, to help resolve the ambiguity of surface and illuminant colors.
As an example, the so-called “gray world” AWB algorithm assumes that the all of the surfaces in a scene average out to gray (e.g., an 18% gray value), and therefore, by averaging all pixel colors of an image, a reasonable estimate of the white point of the scene may be calculated. In some other white balance algorithms, referred to as “selective gray world” algorithms, pixel colors that are not possible responses of a white surface under any practical illuminant are excluded first, and then the rest of the pixels values in the scene are averaged to form a scene white point estimate, again assuming that the surfaces should average out to gray. Other more sophisticated assumptions/models about surface reflectance distribution can be made (and have been done), to improve white balance accuracy above simple gray world or selective gray world algorithms.
However, almost all AWB algorithms have difficulty when the image is dominated by a single-colored surface. In such a case, the so-called dominant color can seriously bias the white point estimate. White balance is especially difficult in cases where the dominant color, when placed under the scene illuminant, gives off a light signal that is similar to what an actual white surface would give off under a different type of scene illuminant. For example, the color of light wood or hay in cool daylight gives a range of pixel responses (due to texture and lighting angle variation), some of which are the same as a white surface under warm tungsten light (e.g., an incandescent light bulb). Similarly, the pixel responses of grass under dusk daylight may have large overlap with pixel values of gray surfaces under some compact fluorescent lights. In these cases, a large portion of the colored surfaces' pixel response cannot safely be excluded when calculating white balance statistics since such values may fall within a range corresponding to proper white points for true illuminants.
Such ambiguity might be better resolved if there are other surfaces in the scene, but when other surfaces are scarce or absent, white balance error can become quite large. For example, an image that is dominated by a light-greenish color, such as a close up on a bunch of green grapes, many of the light-greenish pixel values dominating the image may overlap in chromaticity with the color of a white surface under some fluorescent illuminants. In other words, the AWB process may not be able to distinguish from a bowl of light-greenish grapes in daylight and a piece of white paper illuminated by a greenish fluorescent light, and thus would attempt to color balance the two images in the same way, even though such an approach would not make the grapes render accurately. That is, the white point estimate produced from a weighted sum of all pixel values in the “plausible white” zone for the bowl of grapes image would likely be biased toward a greenish-yellow color, resulting in an over-corrected white balanced image that is too purplish.
Accordingly, there is a need for techniques to provide more accurate white balancing in images dominated by one or more non-white colors. By strategically trimming a two-dimensional (2D) histogram representative of the image data based on factors such as estimated scene lux and typical scene illuminant white point values, white points can be calculated more accurately, while the influence of dominant image colors on scene white point determination can be minimized.